package https.itmanager.com.springboot.extsample;

import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.stereotype.Component;

import java.beans.PropertyDescriptor;

@Component
public class MyInstantiationAwareBeanPostProcessor implements InstantiationAwareBeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean,String beanName)throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean,String beanName)throws BeansException{
        return bean;
    }

    @Override
    public Object postProcessBeforeInstantiation(Class<?> beanClass,String beanName)throws BeansException{
        return null;
    }

    @Override
    public boolean postProcessAfterInstantiation(Object bean,String beanName)throws BeansException{
        return true;
    }

    @Override
    public PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)throws BeansException{
        return pvs;
    }

}
